import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/storageRoom/getPage',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/storageRoom/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/storageRoom/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
export const add = (row) => {
  return request({
    url: '/api/storageRoom/save',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/storageRoom/update',
    method: 'post',
    data: row
  })
}

export const getcamera = (current, size, params) => {
  return request({
    url: '/api/Camera/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getRiskSList = (current, size, params) => {
  return request({
    url: '/api/riskPoint/riskmanagement/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getCameraBinding = (current, size, params) => {
  return request({
    url: '/api/storageRoom/getCameraBindingPage',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const bindingCamera = (ids, id) => {
  return request({
    url: '/api/storageRoom/bindingCamera',
    method: 'post',
    params: {
      ids,
      id
    }
  })
}

// 上传多个文件
export const uploadFiles = (files) => {
  return request({
    url: '/api/fileManager/upload/files',
    method: 'post',
    data: files
  })
}
